cmake_minimum_required (VERSION 2.6) 
project (ONLINE) 

find_package(Armadillo)
find_package(Boost COMPONENTS mpi program_options serialization date_time REQUIRED)
find_package(OpenCV)
find_package(MPI)
find_package(LAPACK)

include_directories(
	${ONLINE_SOURCE_DIR}
	${MPI_CXX_INCLUDE_PATH}
	${ARMADILLO_INCLUDE_DIRS}
	${Boost_INCLUDE_DIRS}
	${OpenCV_INCLUDE_DIRS}
)

link_directories(
  ${Boost_LIBRARY_DIRS}
  ${OpenCV_LIB_DIR}
)

set(Boost_LIBRARIES boost_program_options boost_mpi boost_serialization boost_date_time)
set(OpenCV_LIBS opencv_core opencv_highgui opencv_imgproc)
set(ALL_LIBS   
  batch_factorize
  helper
  ${Boost_LIBRARIES}
  ${LAPACK_LIBRARIES} 
  ${ARMADILLO_LIBRARIES}
  ${MPI_LIBRARIES}
  ${OpenCV_LIBS}
  DNMF
)

message("Boost=" ${Boost_INCLUDE_DIRS} ${Boost_LIBRARY_DIRS} ${Boost_LIBRARIES})
message("LAPACK=" ${LAPACK_LIBRARIES})
message("ARMA=" ${ARMADILLO_INCLUDE_DIRS} ${ARMADILLO_LIBRARIES})
message("MPI=" ${MPI_INCLUDE_PATH} ${MPI_LIBRARIES})
message("OpenCV=" ${OpenCV_INCLUDE_DIRS} ${OpenCV_LIBS} ${OpenCV_LIB_DIR})


add_definitions(-O3 -Wsign-compare -Wreturn-type -Wfatal-errors -Wunused-variable -Wuninitialized)

subdirs(
  data
  algorithm 
  batch_algorithm
  helper
  factorize
  elem_factorize
  )

#add_executable(stochastic
#  online_learning_main.cpp 
#  )

#target_link_libraries (stochastic
#    online_data
#    online_learning
#    ${Boost_LIBRARIES}
#   #${Armadillo_LIBRARY}
#    ) 
